'use strict';

const router = require('koa-router')();

// const { findControllerFiles, registryRouter } = require('../utils/tools');


// function fn(app) {
//     // 找出（指定路径下）所有的控制器文件
//     let files = findControllerFiles();

//     // 遍历控制器文件，批量注册路由
//     registryRouter(files, router);

//     app.use(bodyParser());
//     return router.routes();
// }
async function get(path,fn){
    router.get(path,fn)
}
async function post(path,fn){
    router.post(path,fn)
}
async function put(path,fn){
    router.put(path,fn)
}
async function delet(path,fn){
    router.delete(path,fn)
}
module.exports = {get,post,put,delet,router};